var request = require('request');
var fs = require('fs');


function down(lists) {
    lists.forEach(v => {
        if (v.pic) {
            var tt = new Date().getTime();
            var filename = tt +'.jpg';
            request(v.pic).pipe(fs.createWriteStream('../node4/static/image/'+filename));
            v.pic = './image/' + filename
        }
    })
    return lists
}
exports.down = down;